package com.htu.controller;

import com.htu.po.Cart;
import com.htu.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@ResponseBody
@RequestMapping("/CartController")
public class CartController {
    @Autowired
    private CartService cartService;

    @RequestMapping("/ListCart")
    public List<Cart> ListCart(Cart cart){

        return cartService.listCart(cart);
    }
    @RequestMapping("/saveCart")
    public int saveCart(Cart cart){
        return cartService.saveCart(cart);
    }
    @RequestMapping("/removeCart")
    public int removeCart(Cart cart){
        return cartService.removeCart(cart);
    }
    @RequestMapping("/updateCart")
    public int updateCart(Cart cart){
        return cartService.updateCar(cart);
    }
}
